import { Column, Entity, PrimaryGeneratedColumn, OneToOne, JoinColumn } from "typeorm";
import { User } from "./user.entity";

@Entity()
export class UserProfile {
    @PrimaryGeneratedColumn()
    id: number;

    @Column()
    gender: number;

    @Column()
    photo: string;

    @Column()
    address: string;

    // userId 外键关联
    // @Column()
    // userId: number;

    // user表和userprofile表一对一关联
    @OneToOne(() => User)
    @JoinColumn()
    user: User;
} 